package com.itec.learn.mongodb.entity;


import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Author: Yiqun Chen
 * Date:   2017/9/20
 */
public class PatentsRowMapper implements RowMapper<Patents> {

    @Override
    public Patents mapRow(ResultSet resultSet, int i) throws SQLException {
        Patents patents = new Patents();
        patents.setId(resultSet.getInt("id"));
        patents.setAgency_id(resultSet.getInt("agency_id"));
        patents.setAgency_name(resultSet.getString("agency_name"));
        patents.setAgent_id(resultSet.getInt("agent_id"));
        patents.setAgent_name(resultSet.getString("agent_name"));
        patents.setApplicant_id(resultSet.getInt("applicant_id"));
        patents.setApplicant_name(resultSet.getString("applicant_name"));
        patents.setApplication_type(resultSet.getString("application_type"));
        patents.setApplied_patent(resultSet.getInt("applied_patent"));
        patents.setBrand_id(resultSet.getInt("brand_id"));
        patents.setBrand_name(resultSet.getString("brand_name"));
        patents.setCase_category(resultSet.getString("case_category"));
        patents.setCase_manager_id(resultSet.getInt("case_manager_id"));
        patents.setCase_manager_name(resultSet.getString("case_manager_name"));
        patents.setCategory_id(resultSet.getInt("category_id"));
        patents.setCategory_name(resultSet.getString("category_name"));
        patents.setCountry(resultSet.getString("country"));
        patents.setDepartment_name(resultSet.getString("department_name"));
        patents.setDepartment(resultSet.getInt("department"));
        patents.setExpiration_date(resultSet.getInt("expiration_date"));
        patents.setEngineer_id(resultSet.getInt("engineer_id"));
        patents.setEngineer_name(resultSet.getString("engineer_name"));
        patents.setFiled_date(resultSet.getInt("filed_date"));
        patents.setInternal_application_date(resultSet.getInt("internal_application_date"));
        patents.setInventor_id(resultSet.getInt("inventor_id"));
        patents.setInventor_name(resultSet.getString("inventor_name"));
        patents.setLapse_reason(resultSet.getString("lapse_reason"));
        patents.setPatent_level(resultSet.getString("patent_level"));
        patents.setPatent_name(resultSet.getString("patent_name"));
        patents.setPatent_status(resultSet.getString("patent_status"));
        patents.setProduct_id(resultSet.getInt("product_id"));
        patents.setProduct_name(resultSet.getString("product_name"));
        patents.setPublication_date(resultSet.getInt("publication_date"));
        patents.setTech_id(resultSet.getInt("tech_id"));
        patents.setTech_name(resultSet.getString("tech_name"));
        return patents;
    }
}
